package com.caissa.springboot.starter.permission.enums;

/**
 * 审计日志的记录类型
 *
 * @Author：zhangqiang
 * @Date 2021/8/11 13:34
 */

public enum AuditLogRecordTypeEnum {
    MANAGER_OK("manager_ok", "正常"),
    MANAGER_ERROR("manager_error", "异常"),
    ;
    /**
     * 错误码
     */
    private String code;
    /**
     * 错误描述
     */
    private String desc;

    AuditLogRecordTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(String code){
        for (AuditLogRecordTypeEnum value : values()) {
            if(value.code.equals(code)){
                return value.getDesc();
            }
        }
        return null;
    }

    public String getCode() {
        return this.code;

    }

    public String getDesc() {
        return this.desc;

    }
}
